/*
 * Copyright (C) 2009 Ionut Dediu <deionut@yahoo.com>
 *
 * Licensed under the GNU General Public License Version 2
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

// SmartCam.rss

//  RESOURCE IDENTIFIER
NAME SMAR	// 4 letter ID

#define EDWIN_WIDTH 5
#define EDWIN_LINES 5
#define EDWIN_MAXLENGTH 128


//  INCLUDES
#include <eikon.rh>
#include <avkon.rsg>
#include <avkon.rh>
#include <appinfo.rh>
#include <avkon.mbg>
#include "SmartCam.hrh"
#include "SmartCam.rls"

//  RESOURCE DEFINITIONS
// -----------------------------------------------------------------------------
//
//	Define the resource file signature
//	This resource should be empty.
//
// -----------------------------------------------------------------------------
//
RESOURCE RSS_SIGNATURE
	{
	}

// -----------------------------------------------------------------------------
//
//	Default Document Name
//
// -----------------------------------------------------------------------------
//
RESOURCE TBUF r_default_document_name
	{
	buf="SMAR";
	}

// -----------------------------------------------------------------------------
//
//	Define default menu and CBA key.
//
// -----------------------------------------------------------------------------
//
RESOURCE EIK_APP_INFO
	{
	menubar = r_smartcam_view_finder_menubar;
	cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
	}

// -----------------------------------------------------------------------------
//
//	r_smartcam_view_finder_view
//	View finder view.
//
// -----------------------------------------------------------------------------
//
RESOURCE AVKON_VIEW r_smartcam_view_finder_view
    {
    menubar = r_smartcam_view_finder_menubar;

    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    }

// -----------------------------------------------------------------------------
//
//   r_smartcam_view_finder_menubar
//   Main menubar
//
// -----------------------------------------------------------------------------
//
RESOURCE MENU_BAR r_smartcam_view_finder_menubar
	{
	titles =
		{
		MENU_TITLE { menu_pane = r_smartcam_view_finder_menu; }
		};
	}


// -----------------------------------------------------------------------------
//
//   r_smartcam_view_finder_menu
//   Menu for "Options"
//
// -----------------------------------------------------------------------------
//
RESOURCE MENU_PANE r_smartcam_view_finder_menu
	{
	items =
		{
		MENU_ITEM
				{
				command = ESmartCamCmdConnect;
				txt = qtn_connect;
				},
		MENU_ITEM
				{
				command = ESmartCamCmdDisconnect;
				txt = qtn_disconnect;
				},
		MENU_ITEM
				{
				command = ESmartCamCmdSettings;
				txt = qtn_settings;
				},
/*		MENU_ITEM
				{
				command = ESmartCamCmdHelp;
				txt = qtn_help;
				},*/
		MENU_ITEM
				{
				command = ESmartCamCmdAbout;
				txt = qtn_about;
				},
		MENU_ITEM
				{
				command = EAknSoftkeyExit;
				txt = qtn_exit;
				}
		};
	}

// -----------------------------------------------------------------------------
//
// About dialog resource.
//
// -----------------------------------------------------------------------------
//
RESOURCE DIALOG r_about_query_dialog
	{
	flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
	buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
	items=
		{
		DLG_LINE 
			{
			type = EAknCtPopupHeadingPane;
			id = EAknMessageQueryHeaderId;
			itemflags = EEikDlgItemNonFocusing;
			control = AVKON_HEADING
				{
				};
			},
		DLG_LINE
			{
			type = EAknCtMessageQuery;
			id = EAknMessageQueryContentId;
			control = AVKON_MESSAGE_QUERY
				{
				};
			}
		};
	}


// -----------------------------------------------------------------------------
//
// Resources for messages.
//
// -----------------------------------------------------------------------------
//
RESOURCE TBUF32 r_caption_string { buf=qtn_caption_string; }
RESOURCE TBUF32 r_about_dialog_title { buf=qtn_about_dialog_title; }
RESOURCE TBUF r_about_dialog_text { buf=qtn_about_dialog_text; }


// ---------------------------------------------------------------------------- 
//
// r_localisable_app_info
//
// ---------------------------------------------------------------------------- 
//
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
	{
	short_caption = qtn_caption_string;
	caption_and_icon = 
	CAPTION_AND_ICON_INFO
		{
		caption = qtn_caption_string;

		number_of_icons = 1;
	   	icon_file = "\\resource\\apps\\SmartCam_0xE696FBC9.mif";
		};
	}

// ----------------------------------------------------------------------------
//
// r_connecting_note
//
// ----------------------------------------------------------------------------
//
RESOURCE DIALOG r_connecting_note
	{
	flags = EAknWaitNoteFlags | EEikDialogFlagCbaButtons;
	buttons = R_AVKON_SOFTKEYS_EMPTY;
	items =
		{
		DLG_LINE
			{
			type = EAknCtNote;
			id = EWaitNote;
			control = AVKON_NOTE
				{
				layout = EWaitLayout;
				singular_label = qtn_connecting;
				imagefile = "";
				imageid = EMbmAvkonQgn_note_progress;
				imagemask = EMbmAvkonQgn_note_progress_mask;
				animation = R_QGN_GRAF_WAIT_BAR_ANIM;
				};
			}
		};
	}

RESOURCE DIALOG r_err_msg
	{
	flags = EGeneralQueryFlags;
	buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
	items =
		{
		DLG_LINE
			{
			type = EAknCtQuery;
			id = EGeneralQuery;
			control = AVKON_CONFIRMATION_QUERY
				{
				layout = EConfirmationQueryLayout;
				animation = R_QGN_NOTE_ERROR_ANIM;
				};
			}
		};
	}

RESOURCE DIALOG r_query_server_address
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;

    items =
        {
        DLG_LINE
            {
            type = EAknCtQuery;
            id = EGeneralQuery;
            control = AVKON_DATA_QUERY
                {
                layout = EDataLayout;
                label = STRING_r_chat_data_server_text;
                control = EDWIN
                    {
                    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
                    width = EDWIN_WIDTH;
                    // lines = AKNEXQUERY_EDWIN_LINES;
                    maxlength = EDWIN_MAXLENGTH;
                    // added to limit expanding in forms.
                    // If you want full screen use 6 here
                    max_view_height_in_lines = EDWIN_LINES;
                    // if you have the line above, you must have this.
                    // It's calculable from LAF
                    base_line_delta = 21;
                    };
                };
            }
        };
    }

RESOURCE AVKON_VIEW r_smartcam_settings_view
    {
    cba = R_AVKON_SOFTKEYS_OK_EMPTY;
    }

RESOURCE AVKON_SETTING_ITEM_LIST r_smartcam_settings_list
	{
	title = "Settings";
	items = 
		{
        AVKON_SETTING_ITEM
            {
            identifier = ESettingCameraIndex;
            setting_page_resource = r_radiobutton_page_camera_index;
            name = "Camera";
            },
        AVKON_SETTING_ITEM
        	{
            identifier = ESettingCameraResolution;
            setting_page_resource = r_radiobutton_page_camera_resolution;
            name = "Resolution";
        	},
        AVKON_SETTING_ITEM
        	{
            identifier = ESettingCameraFPS;
            setting_page_resource = r_radiobutton_page_camera_fps;
            name = "FPS";
            },
        AVKON_SETTING_ITEM
        	{
            identifier = ESettingConnectionType;
            setting_page_resource = r_radiobutton_page_connection_type;
            name = "Connection type";
            },
        AVKON_SETTING_ITEM
        	{
            identifier = ESettingInetServerAddr;
            setting_page_resource = r_text_page_inet_server;
            name = "TCP/IP (WiFi) Server";
            },
        AVKON_SETTING_ITEM
        	{
            identifier = ESettingBtServerAddr;
            setting_page_resource = r_text_page_bt_server;
            name = "Bluetooth Server";
            },
        AVKON_SETTING_ITEM
        	{
            identifier = ESettingInetPort;
            setting_page_resource = r_numericeditor_page_tcp_ip_port;
            name = "TCPI/IP (WiFi) Port";
            }
        };
	}

////////////////// camera source //////////////////
RESOURCE AVKON_SETTING_PAGE r_radiobutton_page_camera_index
	{
	label = "Camera source";
	type = EAknCtPopupSettingList;
	editor_resource_id = r_radiobuttons_editor;
	hint_text = "Camera source";
	}

RESOURCE POPUP_SETTING_LIST r_radiobuttons_editor
	{
	}

////////////////// camera resolution ////////////////
RESOURCE AVKON_SETTING_PAGE r_radiobutton_page_camera_resolution
	{
	label = "Camera resolution";
	type = EAknCtPopupSettingList;
	editor_resource_id = r_radiobuttons_editor;
	hint_text = "Camera resolution";
	}

//////////////////// camera fps ////////////////////
RESOURCE AVKON_SETTING_PAGE r_radiobutton_page_camera_fps
	{
	label = "Camera frame rate";
	type = EAknCtPopupSettingList;
	editor_resource_id = r_radiobuttons_editor;
	hint_text = "Camera frame rate";
	}

////////////////// connection type /////////////////
RESOURCE AVKON_SETTING_PAGE r_radiobutton_page_connection_type
	{
	label = "Connection type";
	type = EAknCtPopupSettingList;
	editor_resource_id = r_radiobuttons_editor;
	hint_text = "Connection type";
	}

////////////////// inet server /////////////////
RESOURCE AVKON_SETTING_PAGE r_text_page_inet_server
	{
	label = "TCP/IP (Wifi) Server";
	type = EEikCtEdwin;
	editor_resource_id = r_settinglist_edwin;
	hint_text = "TCP/IP (Wifi) Server";
	}

RESOURCE EDWIN r_settinglist_edwin
    {
    maxlength = 100;
    }

////////////////// bt server /////////////////
RESOURCE AVKON_SETTING_PAGE r_text_page_bt_server
	{
	label = "Bluetooth Server";
	type = EEikCtEdwin;
	editor_resource_id = r_settinglist_edwin;
	hint_text = "Bluetooth Server";
	}

///////////////// inet port number ////////////////
RESOURCE AVKON_SETTING_PAGE r_numericeditor_page_tcp_ip_port
	{
	label = "TCPI/IP (WiFi) Port";
	type  = EAknCtIntegerEdwin;
	editor_resource_id = r_numericeditor;
	}

RESOURCE AVKON_INTEGER_EDWIN r_numericeditor
	{
   	maxlength = 100;
	}
